package com.google.gwt.sample.stockwatcher.client;

import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.*;

public class TabPanelExample extends TabLayoutPanel {

  public TabPanelExample(int numTabs) {
    super(30, Unit.PX);
    for (int i = 0; i < numTabs; i++) {
      add(tabContent(i), tabLabel(i));
    }
    addStyleName("tab-panel");
    setAnimationDuration(500);
  }

  private Widget tabContent(int index) {
    String content = "";
	if ( index==0 ){
		content="hola";
	}else{
		content="adios";
	}
    return (new ScrollPanel(new HTML(content)));
  }

  private String tabLabel(int index) {
    return ("Show Panel " + index);
  }
}
